define(['app'],function(app){return {module: function($scope, $http, eventBusService, httpService, params) {
		
		//查询性别码
		httpService.post(app.urls.dictionary_selectByRule,{fk_rule:"SJAAAAA29"},function(data){
			if("0000" === data.code){
				$scope.xbms = data.data;
			}else{
				alert(data.msg);
			}
		});
		
	   $scope.saveForm = function(){
			if($scope.formCheck()){
			  httpService.post(app.urls.parent_selectRepeatParent,$scope.form,function(data) {
				  if ("0000" === data.code) {
					  $scope.form.type='3';
					  httpService.post(app.urls.user_insert,$scope.form,function(data) {
							if ("0000" === data.code) {
								$scope.form.id = $scope.form.fk_user = data.data;
								httpService.post(app.urls.parent_insert, $scope.form, function (data) {
									if ("0000" === data.code) {
										var menu = {"url": "modules/content/usermanagement/parent/list?father_id=" + params.father_id};
										eventBusService.publish("modules.content.load", menu);
									} else {
										alert(data.msg);
									}
								});
							} else {
								alert(data.msg);
							}
						});
				  } else {
						alert(data.msg);
					}
			  });
			}
	   }
	 //返回
	$scope.goback = function(){
		var menu = {"url": "modules/content/usermanagement/parent/list?father_id=" + params.father_id};
		eventBusService.publish("modules.content.load", menu);
	}
}}});